#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileSystemModel>
#include <QLabel>
#include "extractthread.h"
#include "prbthread.h"
#include "formabout.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void DefaultDisplay();
    void SetFileIcon(const QString &str);

    void setSep2(const QString &path_);
    void setSep3(const QString &path_);
    void getFileInfo(const QString &path_);
    void setSize(const QString &size);

    bool finishedUnpack();
    bool copyFile(const QString &fromDir, const QString &toDir, bool coverFileIfExist);

    void setStatusBar(const QString &s,const QString &t="");


signals:
    void starting(QString path);
    void startingCopy(QString formPath,QString toPath);

private slots:
    void on_nextBtn_clicked();
    void on_lastBtn_clicked();
    void on_toolButton_clicked();
    void on_pushButton_clicked();
    void on_selectPath_clicked();
    void on_tabWidget_currentChanged(int index);

    void showAbout();

private:
    Ui::MainWindow *ui;
    extractThread* eThread;
    PrbThread* pThread;
    FormAbout* aboutForm;

    QString filePath;
    QString fileName;
    QString fileType;
    QString fileDate;
    QString fileSize;
    QString TMPFILEPATH = "/tmp/squashfs-root/";
    QString dataLocation;
    QString iconName;
    QStringList nameList;

    int m_size;
    int max_size;
    int send_count;

    bool unPackFlag;

    bool deleteStatus;
    bool addLaunchStatus;
    bool addDeskStatus;
    QString savePath;

    QLabel* statusLabel;
    QLabel* statusLb2;

};
#endif // MAINWINDOW_H
